package com.llh.designpatterns.singleton.lazy;

/**
 * <h2>懒汉式单例</h2>
 * <p>实现了懒加载。判空代码线程不安全。</p>
 * <p>简单多线程程序还是模拟不出来效果的，我试过了，T_T</p>
 * <p>极其不推荐使用</p>
 * <p>CreatedAt: 2019-11-23 20:02</p>
 * <p><a href="mailto:forever2y_y@163.com">SendMailToMe</a></p>
 *
 * @author llh
 */
class Singleton01 {
    private Singleton01() {
    }

    private static Singleton01 instance;


    static  Singleton01 getInstance() {
        if (null == instance)
            instance = new Singleton01();
        return instance;
    }
}
